package edu.yngsxy.wkstudy.core.sys.model.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import edu.yngsxy.wkstudy.core.model.entity.WkBaseEntity;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import lombok.experimental.Accessors;

import java.io.Serializable;
import jakarta.validation.constraints.*;
import io.swagger.v3.oas.annotations.media.Schema;
/**
 * <p>
 * 用户表
 * </p>
 *
 * @author group 2
 * @since 2025-09-09
 */
@Getter
@Setter
@ToString
@TableName("user")
@Accessors(chain = true)
@Schema(description = "用户表")
public class User extends WkBaseEntity {

    private static final long serialVersionUID = 1L;

    /**
     * 用户ID
     */
    @TableField(value = "user_id")
    @Schema(title = "用户ID", description = "用户ID", requiredMode =Schema.RequiredMode.REQUIRED)
    @NotNull(message = "用户ID不能为空")
    private Integer userId;

    /**
     * 用户名
     */
    @TableField("username")
    @Schema(title = "用户名", description = "用户名", requiredMode =Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "用户名不能为空")
    @Size(max = 50, message = "用户名长度不能超过50个字符")
    private String username;

    /**
     * 密码
     */
    @TableField("password")
    @Schema(title = "密码", description = "密码", requiredMode =Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "密码不能为空")
    @Size(max = 100, message = "密码长度不能超过100个字符")
    private String password;

    /**
     * 用户类型（学生/教师/管理员）
     */
    @TableField("user_type")
    @Schema(title = "用户类型（学生/教师/管理员）", description = "用户类型（学生/教师/管理员）", requiredMode =Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "用户类型（学生/教师/管理员）不能为空")
    @Size(max = 7, message = "用户类型（学生/教师/管理员）长度不能超过7个字符")
    private String userType;

    /**
     * 邮箱
     */
    @TableField("email")
    @Schema(title = "邮箱", description = "邮箱", requiredMode =Schema.RequiredMode.NOT_REQUIRED)
    @Size(max = 100, message = "邮箱长度不能超过100个字符")
    private String email;

    /**
     * 电话
     */
    @TableField("phone")
    @Schema(title = "电话", description = "电话", requiredMode =Schema.RequiredMode.NOT_REQUIRED)
    @Size(max = 20, message = "电话长度不能超过20个字符")
    private String phone;
}
